package com.qf.service;

import com.codingapi.txlcn.tc.annotation.LcnTransaction;
import com.qf.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author sunyamei
 * @version V1.0
 * @Project javase2203
 * @Package com.qf.service
 * @Description:
 * @Date 2022/8/17 11:33
 */
@Service
public class UserServiceImpl implements UserService{

   @Autowired
   private UserMapper userMapper;

   @Transactional
   @LcnTransaction
    @Override
    public Integer incrB() {

        //模拟除灵异常,看事务是否会生效
        int i =1/0;

        Integer count1 = userMapper.incr();
        return count1;
    }
}
